package wsz.resume.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;
import wsz.pojo.Resume;
import wsz.resume.dao.ResumeDao;
import wsz.resume.service.ResumeService;

/**
 * @author wsz
 * @date 2021/12/17 15:05
 **/
@Service
public class ResumeServiceImpl implements ResumeService {
    @Autowired
    private ResumeDao resumeDao;

    @Override
    public Resume findDefauleResumeByUserId(Long userId) {
        Resume resume = new Resume();
        resume.setUserId(userId);
        resume.setIsDefault(1);

        Example<Resume> example = Example.of(resume);
        return resumeDao.findOne(example).get();
    }
}
